package com.wubo.sec.service;

import java.util.List;

import javax.annotation.security.RolesAllowed;

import com.wubo.sec.model.Authority;

/**
 * 
 * @author WuBo
 * @CreateDate 2010-8-3
 * @version 1.0.01
 */
public interface IAuthorityService {
	@RolesAllowed({"ADMIN", "AUTH_READ"})
	List<String[]> listName(String name);
	
	@RolesAllowed({"ADMIN", "AUTH_READ"})
	List<String[]> listType(String type);
	
	@RolesAllowed({"ADMIN", "AUTH_ADD"})
	String create(Authority auth);
	
	@RolesAllowed({"ADMIN", "AUTH_UPDATE", "ACL_PUT"})
	Authority update(Authority auth);
	
	@RolesAllowed({"ADMIN", "AUTH_DELETE", "ACL_DEL"})
	void delete(Authority auth);
	
	@RolesAllowed({"ADMIN", "AUTH_READ"})
	List<Authority> findAll();
	
	@RolesAllowed({"ADMIN", "AUTH_READ"})
	List<Authority> find(String filter, Object[] params);
	
	List<Authority> findRunAs(String filter, Object[] params);
	
	@RolesAllowed({"ADMIN", "AUTH_READ"})
	List<Authority> getSplitPage(int start, int limit, String where, Object... params);
	
	@RolesAllowed({"ADMIN", "AUTH_READ"})
	long getTotal(String where, Object... params);
	
	Authority get(String code);
}
